<script setup>
import { ref } from 'vue';


const show =ref(false)

</script>

<template>

    <h1>Vue Transition</h1>
    <button @click="show = !show">Toggle</button>
    <Transition name="fade">
        <p v-if="show">hello</p>
    </Transition>

    <Transition name="slide-fade">
    <p v-if="show">hello</p>
    </Transition>
</template>

<style scoped>
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.5s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-fade-enter-active {
  transition: all 0.3s ease-out;
}

.slide-fade-leave-active {
  transition: all 0.8s cubic-bezier(1, 0.5, 0.8, 1);
}

.slide-fade-enter-from,
.slide-fade-leave-to {
  transform: translateX(20px);
  opacity: 0;
}
</style>